package com.corner.model.cornerservice.service;

import com.corner.model.cornerservice.domain.User;
import com.corner.model.cornerservice.service.exception.BaseException;

import java.util.List;
import java.util.Map;

import retrofit.http.Body;
import retrofit.http.DELETE;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Path;
import retrofit.http.Query;

public interface UserService {
    @GET("/user/count")
    Map<String, Long> count()
            throws BaseException;

    @GET("/user/count")
    Map<String, Long> count(@Query("query") String query) throws BaseException;

    @GET("/user")
    List<User> list()
            throws BaseException;

    @GET("/user")
    List<User> list(@Query("query") String query) throws BaseException;

    @GET("/user/{objectId}")
    User get(@Path("objectId") Long objectId) throws BaseException;

    @GET("/user/{objectId}")
    User get(@Path("objectId") Long objectId, @Query("query") String query) throws BaseException;

    @PUT("/user/{objectId}")
    Map<String, Object> update(@Path("objectId") Long objectId,
                               @Body User user)
            throws BaseException;

    @DELETE("/user/{objectId}")
    Map<String, Object> delete(@Path("objectId") Long objectId) throws BaseException;

    @POST("/user")
    Map<String, Object> save(@Body User user) throws BaseException;

    @GET("/user/login")
    User login(@Query("phoneNum") String phoneNum,
               @Query("password") String password) throws BaseException;

    @PUT("/user/{objectId}/updatePassword")
    User updatePassword(@Path("objectId") Long objectId,
                        @Body Map<String, String> map) throws BaseException;
}
